#!/bin/sh

dir_="/var/backups"
prefix="etc-backup-"
suffix=".tar.gz"

# Backup
file_="$prefix$(date +"%Y-%m-%d")$suffix"
tar czf "$dir_/$file_" "/etc"

# Remove old backups
find "$dir_"/ -type f -name "$prefix*$suffix" -mtime +30 -delete
